package com.jin.repository;

import com.jin.model.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * 用户数据访问层
 */
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
    
    /**
     * 根据openId查找用户
     */
    Optional<User> findByOpenId(String openId);
    
    /**
     * 根据openId判断用户是否存在
     */
    boolean existsByOpenId(String openId);
}
